package com.dodayum.utils;


import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class UserJurisdictionUtils {

    Map<Integer,String> userJurisdiction = new HashMap<>();
    public UserJurisdictionUtils(){
        userJurisdiction.put(1,"管理员");
        userJurisdiction.put(2,"游客");
        userJurisdiction.put(3,"作者");
    }

    public String queryJurisdictionByKey(Integer key){
        return userJurisdiction.get(key);
    }

    public Integer queryJurisdictionByName(String name){
        Set<Integer> integers = userJurisdiction.keySet();
        for (Integer key : integers) {
            if (userJurisdiction.get(key) .equals(name)){
                return key;
            }
        }
        return null;
    }

}
